<%@ page language="java" contentType="text/html;charset=utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="zh-cn" class="no-js">
<!--<![endif]-->
<head>
    <jsp:include page="../common/common.jsp"/>
    <link rel="stylesheet" type="text/css" href="${path}/assets/plugins/select2/select2.css"/>
    <link rel="stylesheet" type="text/css" href="${path}/assets/plugins/select2/select2-metronic.css"/>
</head>
<body class="page-header-fixed">
<script type="text/javascript" src="${path }/layer/layer.js"></script>
<jsp:include page="../common/header.jsp"/>
<div class="clearfix">
</div>
<div class="page-container">
    <div class="page-sidebar-wrapper"><jsp:include page="../common/menu.jsp"/></div>
    <div class="page-content-wrapper">
        <div class="page-content">
            <div class="row">
                <div class="col-md-12">
                    <div class="portlet box purple">
                        <div class="portlet-title">
                            <div class="caption">
                                <i class="fa fa-file-text-o"></i>相关视频列表
                            </div>
                            <div class="tools">
                                <div class="actions">
                                    <!--  <a href="${path}/relatedVideo/edit" class="btn green"><i class="fa fa-plus"> 新增</i></a>-->
                                    <button type="submit" class="btn green" onclick="save()">保存(勾选的操作)</button>
<!--                                     <button type="submit" class="btn green" onclick="deletevideo()">删除(勾选的操作)</button> -->
                                    <!--  <button type="submit" class="btn green" onclick="but()">获取视频</button>-->
                                </div>
                            </div>
                        </div>
                        <div class="portlet-body">
                            <form id="formQuery" class="form-horizontal" action="${path}/relatedVideo/list">
                                <div class="form-body">
                                    <div class="form-group">
                                       
<!--                                        <label class="col-md-1 control-label">视频名称</label> -->
<!--                                           	<div class="col-md-2"> -->
<!-- 												<input type="text" class="form-control" id="videoName" -->
<!-- 													name="videoName" /> -->
<!-- 											</div> -->
									  <label class="col-md-1 control-label">直播间名称</label>
	                                        <div class="col-md-2">
											    <input type="text" class="form-control" id="liveName" name="liveName" />
										    </div>
									  <label class="col-md-1 control-label">发布时间</label>
                                        	<div class="col-md-4">
                                            <div class="input-group input-large date-picker input-daterange"
                                                 data-date-format="yyyy-mm-dd">
                                                <input type="text" class="form-control" id="startTime" name="startTime" value="${fromDate}"
                                                       readonly="readonly" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
                                                <span class="input-group-addon">to</span>
                                                <input type="text" class="form-control" id="endTime" name="endTime" value="${toDate}"
                                                       readonly="readonly" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
                                            </div>
                                            </div>
                                      
                                        <div class="col-md-1">
                                            <button type="button" class="btn green" onclick="getRelatedVideo()">查询</button>
                                        </div>
                                    </div>
                                </div>
                            </form>
                            <table class="table table-striped table-bordered table-hover" id="newsList"></table>
                            <input type="hidden" id="liveid" name="liveid" value="${liveid}">
                            <input type="hidden" id="liveids" name="liveids" value="${liveids}">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<jsp:include page="../common/footer.jsp"/>
<script type="text/javascript" src="${path}/assets/plugins/calendar/WdatePicker.js"></script>
<script type="text/javascript" src="${path}/assets/plugins/district/linkagesel-min.js"></script>
<script type="text/javascript" src="${path}/operate/js/relatedVideo.js"></script>
<script type="text/javascript" src="${path}/layer/layer.js"></script>
<script>
    var msg = '${msg}';
    var name ='${sessionScope.user.username}';
    $(function () {
        if(msg) App.bubble(200, msg);
        //$("#name").val('${name}');
        $("#startTime").val('${fromDate}');
        $("#endTime").val('${toDate}');
        var mainid='${mainid}';
        var liveid='${liveid}';
//         alert(mainid+"当前直播线路")
        if(mainid!="" && mainid!=null){
//         	alert("根据条件执行查询合作广告")
	        getRelatedVideo(mainid,liveid);
        }else{
        	getRelatedVideo();
        }
     
    });

//  function number(){
// 		$.ajax({
// 		       cache: true,
// 		       type: "POST",
// 		       url:_path+"/relatedVideo/updateNumber/?id=114",
// 		       async: false,
// 		       dataType : "json",
// 		       error: function(request) {
// 		    	   alert("连接错误！");
// 		       },
// 		       success: function(jsondata) {
// 		       }
// 		   });
//  }

 function Refresh(){
		location.reload();
	}

//全选 全不选
	function selectAll(){  
	    if ($("#SelectAll").attr("checked")) {  
	        $(":checkbox").attr("checked", true);  
	    } else {  
	        $(":checkbox").attr("checked", false);  
	    }  
	}
</script>
</body>
</html>
